package org.jmhome.blog.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries({
	@NamedQuery(name = "org.jmhome.blog.model.AttachmentFile", query = "from AttachmentFile as AttachmentFile where fileSeq = :fileSeq") })
public class AttachmentFile {

	@Id
	@GeneratedValue
	private Integer fileSeq;
	
	private String fileCode;

	private String fileName;

	@Column(length = 256)
	private String filePath;

	private Long fileSize;

	@ManyToOne(cascade = { CascadeType.ALL })
	@JoinColumn(name = "board_seq")
	private Board board;

	public AttachmentFile() {
		super();
	}

	
	public AttachmentFile(String fileCode, String fileName, String filePath,
			Long fileSize, Board board) {
		super();
		this.fileCode = fileCode;
		this.fileName = fileName;
		this.filePath = filePath;
		this.fileSize = fileSize;
		this.board = board;
	}


	/**
	 * @return the fileSeq
	 */
	public Integer getFileSeq() {
		return fileSeq;
	}


	/**
	 * @param fileSeq the fileSeq to set
	 */
	public void setFileSeq(Integer fileSeq) {
		this.fileSeq = fileSeq;
	}


	/**
	 * @return the fileCode
	 */
	public String getFileCode() {
		return fileCode;
	}


	/**
	 * @param fileCode the fileCode to set
	 */
	public void setFileCode(String fileCode) {
		this.fileCode = fileCode;
	}


	/**
	 * @return the fileName
	 */
	public String getFileName() {
		return fileName;
	}


	/**
	 * @param fileName the fileName to set
	 */
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}


	/**
	 * @return the filePath
	 */
	public String getFilePath() {
		return filePath;
	}


	/**
	 * @param filePath the filePath to set
	 */
	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}


	/**
	 * @return the fileSize
	 */
	public Long getFileSize() {
		return fileSize;
	}


	/**
	 * @param fileSize the fileSize to set
	 */
	public void setFileSize(Long fileSize) {
		this.fileSize = fileSize;
	}


	/**
	 * @return the board
	 */
	public Board getBoard() {
		return board;
	}


	/**
	 * @param board the board to set
	 */
	public void setBoard(Board board) {
		this.board = board;
	}

}
